import time

from selenium.webdriver.common.by import By
from selenium import webdriver
import unittest
from ddt import ddt,file_data

@ddt
class A3mall(unittest.TestCase):

    def setUp(self) -> None:
        self.driver=webdriver.Firefox()
        self.driver.get('http://10.59.9.12:7001/')
        self.driver.maximize_window()
        time.sleep(3)

    def tearDown(self) -> None:
        time.sleep(3)
        self.driver.quit()
    @file_data(r'D:\gao1\PythonProject4\yamlb.yaml')
    def test_a3mall_01(self,username,password):
        self.driver.find_element(By.XPATH,'/html/body/div[1]/div/div[2]/ul/li[1]/a').click()
        time.sleep(3)
        self.driver.find_element(By.NAME,'username').send_keys(username)
        self.driver.find_element(By.NAME,'password').send_keys(password)
        time.sleep(10)
        self.driver.find_element(By.XPATH,'//*[@id="theForm"]/div[5]/a').click()
        time.sleep(4)
        #断言：欢迎回来
        # dy=self.driver.find_element(By.XPATH,'/html/body/div[5]/div[2]/div[1]/div[2]/div[2]/ul/li[1]').text
        # print("断言：",dy)
